<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		姓名：<input type="text" id="username" onchange="fun1()"/>
		<hr />
		文本框的值被修改为：<span></span>
		
		<script type="text/javascript">
			function fun1(){
				document.querySelector("span").innerHTML=document.getElementById("username").value
			}
			document.body.oncopy=function(){
				alert("此网页不允许复制")
				event.preventDefault()
			}
			document.getElementById("username").addEventListener("paste",function(){
				alert("输入框不允许粘贴")
				event.preventDefault()
			})
		</script>
	</body>
</html>
